package wibrst.utils {
	import flash.text.TextField;
	import flash.text.TextFormat;
	/**
	 * ...
	 * @author wibrst@qq.com
	 */
	public class TextUtil {
		
		static public function reflect( tx:TextField ):TextFormat {
			return tx.getTextFormat();
		}
		
		static public function focusTx( tx:TextField ):Boolean {
			if ( tx.stage ) {
				tx.stage.focus = tx; 
				trace( "StringUtil.initTxPnIn OK!!! -> " + tx );
				return true;
			}
			return false;
		}
		
		static public function initTxPNIn( tx:TextField ):void{
			//tx.alwaysShowSelection = true;
			tx.multiline = false;
			tx.embedFonts = false;
			tx.restrict = "0-9";
			tx.maxChars = 11;
		}
		
		static public function initTxAuthIn( tx:TextField, nMaxChars:Number = 10 ):void {
			//tx.alwaysShowSelection = true;
			tx.multiline = false;
			tx.embedFonts = false;
			tx.restrict = "0-9a-zA-Z";
			tx.maxChars = nMaxChars;
		}
		
	}

}